from ..base import BaseModule
from .service import ChatService
from utils.response import *

class ChatModule(BaseModule):
    def init_module(self):
        """初始化"""
        self.service = ChatService(self.logger, self.config)
        
    def register_routes(self):
        """注册路由"""
        # 升级包管理
        self.app.route('/api/hello', methods=['GET'])(self.hello)
    
    def cleanup(self):
        pass
        

    def hello(self):
        """hello test"""
        try:
            return success_response(test="hello world", message="获取成功")
        except Exception as e:
            self.logger.error(f"Failed to get package progress: {e}")
            return server_error_response(message=str(e))
            
    